# 导入包
import time

import testsuit.tool.jspyautogui as jpg
import pyautogui as pg
from testsuit.tempcase import chuanceDataCheck as cdc

# 设置图形化等待时间
jpg.PAUSE = 0.1
#
oppkey = "AH20230317425422,GD20220311643257,GD20250107398641,GD20250110370501,NX20240919420870,YN20240426486285,HB20210707458126,HB20240311328328,TJ20220221451004"
list_oppkey = oppkey.split(",")
time.sleep(2)
for one in list_oppkey:
    cdc.searchOpp(one, jpg, pg)
    cdc.ywjgCheck(one, jpg, pg)

# def login(username,phone,code):
#     """
#     进行账号登录方法
#     :param username: 用户名
#     :param phone: 手机号
#     :param code: 验证码
#     :return: bool
#     """
#     # 导入包
#     import testsuit.tool.jspyautogui as jpg
#     import pyautogui as pg
#     from testsuit.tempcase import chuanceDataCheck as cdc
#     # 设置图形化等待时间
#     jpg.PAUSE = 0.1
    # # 填写username
    # jpg.click("./img/login/username.png", confidence=0.7)
    # pg.typewrite(username)
    # time.sleep(1)
    # # 填写手机号
    # jpg.click("./img/login/phone.png", confidence=0.7)
    # pg.typewrite(phone)
    # time.sleep(1)
    # # 填写验证
    # jpg.click("./img/login/code.png", confidence=0.7)
    # pg.typewrite(code)
    # time.sleep(1)
    # # 点击登录按钮
    # jpg.click("./img/login/login.png", confidence=0.7)
    # time.sleep(2)
    # try:
    #     login_x,login_y = pg.center(tuple[int,int,int,int](pg.locateOnScreen(image="./img/index/index_page_title.png", confidence=0.7)))
    # except pg.raisePyAutoGUIImageNotFoundException:
    #     print("登录失败,进入首页失败")
    #     return False
    # else:
    #     print("登录成功")
    #     return True